#pragma once

#include <QVector3D>
#include <QObject>
#include <QByteArray>
#include "rviz_custom_plugins/models/point_normal.h"


namespace rviz_custom_plugins 
{


namespace models 
{


class Plane
{

public:
    Plane() = default;

    ~Plane() = default;

    int id = 0;
    std::vector<PointNormal> points;
};


inline void to_json(json& j, const Plane& p)
{
    j = json{
        {"id", p.id},
        {"points", p.points}
    };
}


inline void from_json(const json&j, Plane& p)
{
    p.id = j.at("id").get<int>();
    p.points = j.at("points");
}


}


}


Q_DECLARE_METATYPE(rviz_custom_plugins::models::Plane)